<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>日期对象</title>
</head>
<body>

</body>
<script>

   /*   var now= new Date();
      document.write(now.toLocaleDateString());
      document.write("<br/>");


       document.write("year:"+now.getFullYear());
      document.write("<br/>");

      document.write("month:"+(now.getMonth()+1));
      document.write("<br/>");

      document.write("date:"+now.getDate());
      document.write("<br/>");

      document.write("hours:"+now.getHours());
      document.write("<br/>");

      document.write("minutes:"+now.getMinutes());
      document.write("<br/>");

      document.write("seconds:"+now.getSeconds());
      document.write("<br/>");

      now.setFullYear(2089);
      document.write("year:"+now.getFullYear());
      document.write("<br/>");


      var newDate = "2090-1-1";
      newDate=Date.parse(newDate);

      document.write("new Date:"+new Date(newDate).toLocaleDateString());
      document.write("<br/>");
*/



     window.setInterval(function () {

       var now = new Date();

       var hour=now.getHours();
       var minute=now.getMinutes();
       var second=now.getSeconds();
       document.write(hour+":"+minute+":"+second+"<br/>");
     },1000)


</script>
</html>